package com.scpii.api.domain.auto;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;

import com.scpii.api.common.base.FilterEntity;
import com.scpii.api.common.json.serializer.ResourceUrlSerializer;

public class UserCars extends FilterEntity implements Serializable {

	@NotNull
	@Pattern(regexp = "^[\u4e00-\u9fa5]{1}[A-Z]{1}[A-Z_0-9]{5}$")
	private String licenceId;

	private Long userId;

	@JsonIgnore
	private Long carModleId;

	private String carModleStr;

	private Date createDt;

	@JsonIgnore
	private Long createBy;

	@JsonIgnore
	private Date updateDt;

	@JsonIgnore
	private Long updateBy;

	@JsonIgnore
	private Long appId;

	@NotNull
	private Long mileage;

	@DateTimeFormat(iso = ISO.DATE)
	private Date insuranceDate;

	@DateTimeFormat(iso = ISO.DATE)
	private Date buyCarDate;

	@JsonSerialize(using = ResourceUrlSerializer.class, include = JsonSerialize.Inclusion.NON_NULL)
	private String thumbImage;

	private List<UserImports> userImports;

	private static final long serialVersionUID = 1L;

	public String getLicenceId() {
		return licenceId;
	}

	public void setLicenceId(String licenceId) {
		this.licenceId = licenceId == null ? null : licenceId.trim();
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getCarModleId() {
		return carModleId;
	}

	public void setCarModleId(Long carModleId) {
		this.carModleId = carModleId;
	}

	public String getCarModleStr() {
		return carModleStr;
	}

	public void setCarModleStr(String carModleStr) {
		this.carModleStr = carModleStr == null ? null : carModleStr.trim();
	}

	public Date getCreateDt() {
		return createDt;
	}

	public void setCreateDt(Date createDt) {
		this.createDt = createDt;
	}

	public Long getCreateBy() {
		return createBy;
	}

	public void setCreateBy(Long createBy) {
		this.createBy = createBy;
	}

	public Date getUpdateDt() {
		return updateDt;
	}

	public void setUpdateDt(Date updateDt) {
		this.updateDt = updateDt;
	}

	public Long getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(Long updateBy) {
		this.updateBy = updateBy;
	}

	public Long getAppId() {
		return appId;
	}

	public void setAppId(Long appId) {
		this.appId = appId;
	}

	public Long getMileage() {
		return mileage;
	}

	public void setMileage(Long mileage) {
		this.mileage = mileage;
	}

	public Date getInsuranceDate() {
		return insuranceDate;
	}

	public void setInsuranceDate(Date insuranceDate) {
		this.insuranceDate = insuranceDate;
	}

	public Date getBuyCarDate() {
		return buyCarDate;
	}

	public void setBuyCarDate(Date buyCarDate) {
		this.buyCarDate = buyCarDate;
	}

	public String getThumbImage() {
		return thumbImage;
	}

	public void setThumbImage(String thumbImage) {
		this.thumbImage = thumbImage == null ? null : thumbImage.trim();
	}

	public List<UserImports> getUserImports() {
		return userImports;
	}

	public void setUserImports(List<UserImports> userImports) {
		this.userImports = userImports;
	}

}